<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title>添加TestCase</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" type="text/css" href="./ext/bootstrap/css/bootstrap.min.css" >
    <link rel="stylesheet" type="text/css" href="./ext/bootstrap-table/dist/bootstrap-table.min.css" >
    <link href="./ext/bootstrap-formvalidation/dist/css/formValidation.min.css" rel="stylesheet">
    <link rel="stylesheet" href="./ext/bootstrap-select/dist1.12.4/css/bootstrap-select.min.css">
    <link rel="stylesheet" href="./css/index.css">
        <!-- 设置缓存过期时间 2小时 -->
    <meta http-equiv="expires" content="7200" >
     <!-- 外链图片 -->
    <meta name="referrer" content="no-referrer" />
    <script type="text/javascript" src="ext/bootstrap/jquery/jquery3.2.1.js"></script>
    <script type="text/javascript" src="ext/bootstrap/js/bootstrap.min.js"></script>
    <!-- 引入table相关 js -->
    <script type="text/javascript" src="ext/bootstrap-table/dist/bootstrap-table.min.js"></script>
    <script type="text/javascript" src="ext/bootstrap-table/dist/locale/bootstrap-table-zh-CN.min.js"></script>
    <script type="text/javascript" src="ext/bootstrap-table/dist/extensions/defer-url/bootstrap-table-defer-url.js"></script>
    <!-- 引入bootbox相关 js -->
    <script src="ext/boot-box/bootbox.min.js"></script>
    <script src="ext/boot-box/bootbox.locales.min.js"></script>
    <!-- 序列化json -->
    <script src="ext/bootstrap/jquery/jquery.serializejson.min.js"></script>
    <!-- 引入表单校验个相关 js -->
    <script type="text/javascript" src="ext/bootstrap-formvalidation/dist/js/formValidation.js"></script>
    <script type="text/javascript" src="ext/bootstrap-formvalidation/dist/js/framework/bootstrap.js"></script>
    <script type="text/javascript" src="ext/bootstrap-formvalidation/dist/js/language/zh_CN.js"></script>
    <!-- 引入bootstrap-select相关 js -->
    <script src="ext/bootstrap-select/dist1.12.4/js/bootstrap-select.min.js"></script>
    <!-- 引入echarts相关 js -->
    <script src="ext/echarts/echarts.min.js"></script>
    <!-- ACE js -->
    <script src="./ext/ace/src/ace.js"></script>
    <script src="./ext/ace/src/ext-language_tools.js"></script>
    <!-- <script type="text/javascript" src="/static/js/jsonpath.js"></script> -->
    <style>
        .tab-pane>.panel-body{
            padding: 5px 0 0 0;
        }
        .tab-pane>.panel-body .panel-body{
            padding: 5px 0 0 0;;
        }  
        .panel {
            margin: 0 0 15px 0;
        }
        </style>
</head>
<body>
<div class="wrap">
    <!-- 左边内容 -->
       <div id="left" class="left">
    <script type="text/javascript">
    </script>
     
        <div id="main-top" >
            <p id="main-user" >欢迎您:<span id="login-user"></span> &nbsp;&nbsp;
               <br> <button class="btn btn-xs btn-danger" id="logout">退 出</button>
            </p>
            <script type="text/javascript">
                // 判断是否登录
                user = window.localStorage.getItem("username")
                if (!user) {
                    location.href="login.html";
                }
                else {
                    document.getElementById("login-user").innerHTML = user || '-'
                }
                // 点注销，退出登录
                $('#logout').click(function(){
                    $.ajax({
                    type:'post',
                    url:'/api/logout',
                    contentType: "application/json",
                    dataType:'json',
                    beforeSend: function() {
                        // 发送请求，禁用提交按钮
                        $('#logout').attr('disabled', 'disabled');
                        },
                    complete: function () {
                        // 请求完成移除 disabled 属性
                        $('#logout').removeAttr('disabled');
                    },
                    success: function(result, status, xhr){
                        /** 删除账号
                        * localStorage.remove(user) 删除值
                        * localStorage.clear() 清空全部
                        */
                        window.localStorage.clear()
                        // 重定向到登录页
                        location.href="login.html";
                    }
                });
                })
            </script>
        </div>
        <div class="panel">
        <div class="panel-body">
            <span class="glyphicon glyphicon-cog" style="color: rgb(255, 140, 60);"></span>
            <a class="text-left" href="#">项目管理</a>
            <ul class="list-unstyled">
                <li><a class="text-left" href="add_project.html">新增项目</a></li>
                <li><a class="text-left" href="list_project.html">项目配置</a></li>
            </ul>
        </div>
        </div>
       
        <div class="panel">
            <div class="panel-body">
            <span class="glyphicon glyphicon-cog" style="color: rgb(255, 140, 60);"></span>
            <a class="text-left" href="#">用例管理</a>
            <ul class="list-unstyled">
                <li><a class="text-left" href="import_case.html">导入用例</a></li>
                <li><a class="text-left" href="add_api.html">新增 API</a></li>
                <li><a class="text-left" href="list_api.html">API 列表</a></li>
                <li><a class="text-left" href="add_case.html">新增用例</a></li>
                <li><a class="text-left" href="list_case.html">用例列表</a></li>
            </ul>
            </div>
        </div>
       
        <div class="panel">
            <div class="panel-body">
                <span class="glyphicon glyphicon-cog" style="color: rgb(255, 140, 60);"></span>
                <a class="text-left" href="#">测试计划</a>
                <ul class="list-unstyled">
                <li><a class="text-left" href="list_report.html">项目报告</a></li>
                <!-- <li><a class="text-left" href="add_plan.html">创建计划</a></li> -->
                <li><a class="text-left" href="list_myplan.html">我的计划</a></li>
                <li><a class="text-left" href="list_task.html">定时任务</a></li>
                <!-- <li><a class="text-left" href="export.html">导出项目</a></li> -->
                </ul>
            </div>
        </div>
        <div class="panel">
            <div class="panel-body">
                <span class="glyphicon glyphicon-cog" style="color: rgb(255, 140, 60);"></span>
                <a class="text-left"  href="#">学习交流</a>
                <ul class="list-unstyled">
                    <li><a class="text-left" target="_blank" href="https://gitee.com/yoyoketang/pytest-yaml-yoyo">yaml 用例教程</a></li>    
                <!-- <li><a class="text-left" target="_blank" href="https://tool.lu/crontab/">Cron在线语法</a></li> -->
                <li><a class="text-left" href="doc.html">联系我们</a></li>
                </ul>
            </div>
        </div>
    </div>

    <div id="right" class="container">
        <!-- 右边顶部导航 -->
        <div id="right-top">
    <ul class="nav nav-tabs">
        <li role="presentation" class="active"><a href="index.html">DashBoard</a></li>
        <li role="presentation"><a class="btn btn-info" href="list_report.html">查看报告</a></li>
        <li role="presentation"><a class="btn btn-success" href="list_task.html">定时任务</a></li>
        <li role="presentation"><a class="btn btn-success" href="export.html">导出用例</a></li>
    </ul>
</div>


    

        <!-- {#    //点保存按钮，弹出模态框 #} -->
        <div class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" id="myModal">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title" id="myModalLabel">保存用例</h4>
                    </div>
                    <div class="modal-body">
                        <form action="" class="form-horizontal" id="model-form">
                            <div class="form-group">
                                <div class="col-sm-8">
                                    <input type="hidden" name="id" class="form-control" id="modal_id" >
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="name" class="col-sm-2 col-md-2 control-label">用例名称</label>
                                <div class="col-sm-9 col-md-9">
                                    <input type="text" name="name" class="form-control" id="name">
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="modal_project" class="col-sm-2 col-md-2 control-label" >所属项目</label>
                                <div class="col-sm-9 col-md-9">
                                    <select id="modal_project" name="modal_project" class="selectpicker form-control show-tick" data-live-search ="true" data-size="5" title="请选择">
                                        <option value="" title="请选择">请选择</option>
                                    </select>
                                </div>
                            </div>
                        

                        </form>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-success" id="save_edit">保存</button>
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-xs-12, col-sm-12, col-md-12, col-lg-12">
                <div class="panel panel-success">
                    <!-- <div class="panel-heading">新增 Case </div> -->
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-md-5">
                                <div class="panel panel-default">
                                    <div class="panel-heading">
                                        <h3>导入 yaml 用例(支持多个)</h3>
                                    </div>
                                    <div class="panel-body">
                                        <form action="/api/up_yaml" method="POST" class="form-horizontal" id="up_yaml" enctype="multipart/form-data">
                                            <div class="form-group">
                                              <label class="control-label col-sm-3 col-md-3" for="yaml_files">上传用例：</label>
                                               <div class="col-sm-8 col-md-8">
                                                <input name='yaml_files' type="file" multiple id="yaml_files">
                                                <p align="left" class="help-block">请选择.yaml或.yml用例上传</p>
                                               </div>
                                             </div>
                                             <div class="form-group">
                                                <label for="project_yaml" class="col-sm-3 col-md-3 control-label" >所属项目：</label>
                                                <div class="col-sm-8 col-md-8">
                                                    <select id="project_yaml" name="project_yaml" class="selectpicker form-control show-tick" data-live-search ="true" data-size="5" title="请选择">
                                                        <option value="" title="请选择">请选择</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="control-label col-sm-3 col-md-3" for="module_name">模块名称：</label>
                                                 <div class="col-sm-8 col-md-8">
                                                  <input name='module_name' type="text" class="form-control" id="module_name" placeholder="模块名称">
                                                 </div>
                                               </div>
                                            <div class="form-group">
                                                <div class="col-xs-12 col-md-offset-3 col-md-4 col-sm-offset-3 col-sm-4">
                                                    <input id="up_yaml" type="submit" class="btn btn-success btn-block" value="点击上传">
                                                </div>
                                            </div>
                                    
                                        </form>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-5">
                                <div class="panel panel-default">
                                    <div class="panel-heading">
                                        <h3>导入 API 层接口(支持多个)</h3>
                                    </div>
                                    <div class="panel-body">
                                        <form action="/api/up_api" method="POST" class="form-horizontal" id="up_api" enctype="multipart/form-data">
                                            <div class="form-group">
                                              <label class="control-label col-sm-3 col-md-3" for="api_yaml_files">上传API层：</label>
                                               <div class="col-sm-8 col-md-8">
                                                <input name='api_yaml_files' type="file" multiple id="api_yaml_files">
                                                <p align="left" class="help-block">请选择 api 层 .yml 或 .yaml 文件上传</p>
                                               </div>
                                             </div>
                                             <div class="form-group">
                                                <label for="project_api" class="col-sm-3 col-md-3 control-label" >所属项目：</label>
                                                <div class="col-sm-8 col-md-8">
                                                    <select id="project_api" name="project_api" class="selectpicker form-control show-tick" data-live-search ="true" data-size="5" title="请选择">
                                                        <option value="" title="请选择">请选择</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <div class="col-xs-12 col-md-offset-3 col-md-4 col-sm-offset-3 col-sm-4">
                                                    <input id="up_api" type="submit" class="btn btn-success btn-block" value="点击上传">
                                                </div>
                                            </div>
                                    
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="js/import-case.js"></script>

</body>
</html>



